package com.x.zssqservice.api;

import com.x.zssqservice.bean.AutoComplete;
import com.x.zssqservice.bean.BookDetail;
import com.x.zssqservice.bean.BookHelp;
import com.x.zssqservice.bean.BookHelpList;
import com.x.zssqservice.bean.BookListDetail;
import com.x.zssqservice.bean.BookListTags;
import com.x.zssqservice.bean.BookLists;
import com.x.zssqservice.bean.BookMixAToc;
import com.x.zssqservice.bean.BookRead;
import com.x.zssqservice.bean.BookReview;
import com.x.zssqservice.bean.BookReviewList;
import com.x.zssqservice.bean.BookSource;
import com.x.zssqservice.bean.BooksByCats;
import com.x.zssqservice.bean.BooksByTag;
import com.x.zssqservice.bean.CategoryList;
import com.x.zssqservice.bean.CategoryListLv2;
import com.x.zssqservice.bean.ChapterRead;
import com.x.zssqservice.bean.CommentList;
import com.x.zssqservice.bean.DiscussionList;
import com.x.zssqservice.bean.Disscussion;
import com.x.zssqservice.bean.HotReview;
import com.x.zssqservice.bean.HotWord;
import com.x.zssqservice.bean.PostCount;
import com.x.zssqservice.bean.RankingList;
import com.x.zssqservice.bean.Rankings;
import com.x.zssqservice.bean.Recommend;
import com.x.zssqservice.bean.RecommendBookList;
import com.x.zssqservice.bean.SearchDetail;

import java.util.List;

import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;


public interface BookApiService {

    @GET("/book/recommend")
    Observable<Recommend> getRecomend(@Query("gender") String gender);


    @GET("/atoc")
    Observable<List<BookSource>> getABookSource(@Query("view") String view, @Query("book") String book);


    @GET("/btoc")
    Observable<List<BookSource>> getBBookSource(@Query("view") String view, @Query("book") String book);

    @GET("/mix-atoc/{bookId}")
    Observable<BookMixAToc> getBookMixAToc(@Path("bookId") String bookId, @Query("view") String view);

    @GET("/mix-toc/{bookId}")
    Observable<BookRead> getBookRead(@Path("bookId") String bookId);

    @GET("/btoc/{bookId}")
    Observable<BookMixAToc> getBookBToc(@Path("bookId") String bookId, @Query("view") String view);

    @GET("http://chapter2.zhuishushenqi.com/chapter/{url}")
    Observable<ChapterRead> getChapterRead(@Path("url") String url);

    @GET("/post/post-count-by-book")
    Observable<PostCount> postCountByBook(@Query("bookId") String bookId);

    @GET("/post/total-count")
    Observable<PostCount> postTotalCount(@Query("books") String bookId);

    @GET("/book/hot-word")
    Observable<HotWord> getHotWord();


    @GET("/book/auto-complete")
    Observable<AutoComplete> autoComplete(@Query("query") String query);


    @GET("/book/fuzzy-search")
    Observable<SearchDetail> searchBooks(@Query("query") String query);


    @GET("/book/accurate-search")
    Observable<BooksByTag> searchBooksByAuthor(@Query("author") String author);


    @GET("/post/review/best-by-book")
    Observable<HotReview> getHotReview(@Query("book") String book);

    @GET("/book-list/{bookId}/recommend")
    Observable<RecommendBookList> getRecommendBookList(@Path("bookId") String bookId, @Query("limit") String limit);

    @GET("/book/{bookId}")
    Observable<BookDetail> getBookDetail(@Path("bookId") String bookId);

    @GET("/book/by-tags")
    Observable<BooksByTag> getBooksByTag(@Query("tags") String tags, @Query("start") String start, @Query("limit") String limit);


    @GET("/ranking/gender")
    Observable<RankingList> getRanking();


    @GET("/ranking/{rankingId}")
    Observable<Rankings> getRanking(@Path("rankingId") String rankingId);


    @GET("/book-list")
    Observable<BookLists> getBookLists(@Query("duration") String duration, @Query("sort") String sort, @Query("start") String start, @Query("limit") String limit, @Query("tag") String tag, @Query("gender") String gender);


    @GET("/book-list/tagType")
    Observable<BookListTags> getBookListTags();


    @GET("/book-list/{bookListId}")
    Observable<BookListDetail> getBookListDetail(@Path("bookListId") String bookListId);


    @GET("/cats/lv2/statistics")
    Observable<CategoryList> getCategoryList();


    @GET("/cats/lv2")
    Observable<CategoryListLv2> getCategoryListLv2();


    @GET("/book/by-categories")
    Observable<BooksByCats> getBooksByCats(@Query("gender") String gender, @Query("type") String type, @Query("major") String major, @Query("minor") String minor, @Query("start") int start, @Query("limit") int limit);


    @GET("/post/by-block")
    Observable<DiscussionList> getBookDisscussionList(@Query("block") String block, @Query("duration") String duration, @Query("sort") String sort, @Query("type") String type, @Query("start") String start, @Query("limit") String limit, @Query("distillate") String distillate);


    @GET("/post/{disscussionId}")
    Observable<Disscussion> getBookDisscussionDetail(@Path("disscussionId") String disscussionId);


    @GET("/post/{disscussionId}/comment/best")
    Observable<CommentList> getBestComments(@Path("disscussionId") String disscussionId);


    @GET("/post/{disscussionId}/comment")
    Observable<CommentList> getBookDisscussionComments(@Path("disscussionId") String disscussionId, @Query("start") String start, @Query("limit") String limit);


    @GET("/post/review")
    Observable<BookReviewList> getBookReviewList(@Query("duration") String duration, @Query("sort") String sort, @Query("type") String type, @Query("start") String start, @Query("limit") String limit, @Query("distillate") String distillate);


    @GET("/post/review/{bookReviewId}")
    Observable<BookReview> getBookReviewDetail(@Path("bookReviewId") String bookReviewId);


    @GET("/post/review/{bookReviewId}/comment")
    Observable<CommentList> getBookReviewComments(@Path("bookReviewId") String bookReviewId, @Query("start") String start, @Query("limit") String limit);


    @GET("/post/help")
    Observable<BookHelpList> getBookHelpList(@Query("duration") String duration, @Query("sort") String sort, @Query("start") String start, @Query("limit") String limit, @Query("distillate") String distillate);


    @GET("/post/help/{helpId}")
    Observable<BookHelp> getBookHelpDetail(@Path("helpId") String helpId);


    @GET("/post/by-book")
    Observable<DiscussionList> getBookDetailDisscussionList(@Query("book") String book, @Query("sort") String sort, @Query("type") String type, @Query("start") String start, @Query("limit") String limit);


    @GET("/post/review/by-book")
    Observable<HotReview> getBookDetailReviewList(@Query("book") String book, @Query("sort") String sort, @Query("start") String start, @Query("limit") String limit);

    @GET("/post/original")
    Observable<DiscussionList> getBookOriginalList(@Query("block") String block, @Query("duration") String duration, @Query("sort") String sort, @Query("type") String type, @Query("start") String start, @Query("limit") String limit, @Query("distillate") String distillate);
}